package com.kabigon.kitoolsj2cache.config;

import net.oschina.j2cache.CacheChannel;
import net.oschina.j2cache.J2CacheBuilder;
import net.oschina.j2cache.J2CacheConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.IOException;

/**
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.kitoolsj2cache.config
 * @data 2023-07-30 23:49
 */
@Configuration
public class J2cacheConfig {

    @Bean
    public CacheChannel cacheChannel() throws IOException {
        J2CacheConfig config = J2CacheConfig.initFromConfig("/j2cache.properties");
        return J2CacheBuilder.init(config).getChannel();

    }

}
